package org.lw.ssm.service.impl;
import org.lw.ssm.Entity.Employee;
import org.lw.ssm.mapper.EmployeeMapper;
import org.lw.ssm.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImpl implements EmployeeService {

    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public List<Employee> getAllEmployees() {
        return employeeMapper.getAllEmployees();
    }

    @Override
    public Employee getEmployeeById(Long id) {
        return employeeMapper.getEmployeeById(id);
    }

    @Override
    public void insertEmployee(Employee employee) {
        employeeMapper.insertEmployee(employee);
    }

    @Override
    public void updateEmployee(Employee employee) {
        employeeMapper.updateEmployee(employee);
    }

    @Override
    public void deleteEmployee(Long id) {
        employeeMapper.deleteEmployee(id);
    }

    @Override
    public List<Employee> getEmployeeByDeptId(Long id) {
        return employeeMapper.getEmployeesByDepartmentId(id);
    }
}

